SSTACK SEGMENT STACK
DB 100 DUP(?)
SSTACK ENDS
DATA SEGMENT
NUM DB 1,-1,2,-2,3,-3,4,4,5,-5,6,-6,-7,8,9,10,-8,9,10,11
P DB 20 DUP(?)
PNUM DB 0
N DB 20 DUP(?)
NNUM DB 0
DATA ENDS
CODE SEGMENT
MAIN PROC FAR
ASSUME CS:CODE	
ASSUME DS:DATA	
ASSUME SS:SSTACK
START:	PUSH DS
	XOR AX,AX
	PUSH AX
	MOV AX,DATA
	MOV DS,AX
	XOR BX,BX
	MOV SI,BX
	MOV DI,BX
	MOV CX,20
LOP1:	MOV AL,NUM[BX]
	CMP AL,0
	JGE P1
	MOV N[DI],AL
	INC DI
	INC NNUM
	JMP NEXT
P1:	MOV P[SI],AL
	INC SI
	INC PNUM
NEXT:	INC BX
	LOOP LOP1
	RET
MAIN ENDP
CODE ENDS
END START

